package com.sinodata.bsm.center.web.action.config;

import com.sino.uam.support.UAMFascade;
import com.sinodata.bsm.center.web.action.BaseAction;

/**
 * <p>
 * Description:
 * </p>
 * 
 * @author liulibo
 * @version 1.0
 * 
 * <p>
 * History:
 * 
 * Date Author Version Description
 * ---------------------------------------------------------------------------------
 * 2012-5-10 下午3:00:02 liulibo 1.0 To create
 * </p>
 * 
 * @since
 * @see
 */
public class UserInfoAction extends BaseAction {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 7893925802375666008L;

    /*
     * (non-Javadoc)
     * 
     * @see com.sinodata.bsm.center.web.action.BaseAction#list()
     */
    @Override
    public String list() throws Exception {

        return this.SUCCESS;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sinodata.bsm.center.web.action.BaseAction#input()
     */
    @Override
    public String input() throws Exception {

        return null;
    }

    /**
     * 同步用户中心
     * 
     * @return
     * @throws Exception
     */
    public String synUserInfo() throws Exception {
        logger.info(">>>>> begin synchronize Userinfo ");
        UAMFascade.getUserInfoFactory().reload();
        UAMFascade.getDepartmentFactory().load();
        UAMFascade.getRoleFactory().load();
        logger.info(">>>>> end synchronize Userinfo ");
        int userSize = UAMFascade.getUserInfoFactory().getUserMap().size();
        this.renderText("" + userSize);
        return null;
    }

    /**
     * 同步用户信息
     * 
     * @return
     * @throws Exception
     */
    public String reRegistry() throws Exception {
        logger.info(">>>>> begin reRegistry uam ");
        // MessageSender.notifyConnect(10, UAMFascade.getUAMRequest().getAppSystem());
        return null;
    }

    @Override
    public String save() throws Exception {

        return null;
    }

    @Override
    public String delete() throws Exception {

        return null;
    }

    @Override
    protected void prepareModel() throws Exception {

    }

    @Override
    public Object getModel() {
        // TODO Auto-generated method stub
        return null;
    }
}
